<template>
    <div class="history-item">
        <div class="row">
            <div class="cover-img">
                <img :src="item.detail.item.coverImg" />
            </div>
            <div class="content column">
                <div class="title text-overflow-ellipsis-1">
                    {{ item.detail.item.title }}
                </div>
                <div class="desc text-overflow-ellipsis-1">
                    {{ item.detail.item.desc }}
                </div>

                <div class="time">{{ viewTime }}</div>
            </div>
        </div>
    </div>
</template>

<script>
import { getDateInfo } from "@/utils/date";

export default {
    props: {
        item: Object
    },
    data() {
        return {};
    },
    computed: {
        viewTime() {
            const { month, day, minute, hour } = getDateInfo(
                this.item.viewStamp
            );
            return `${month}-${day} ${hour}:${minute}`;
        }
    },
    methods: {}
};
</script>


<style lang="less" scoped>
.history-item {
    padding: 30px 0;
    border-bottom: 1px solid #eee;
    .row {
        width: 100%;
        justify-content: space-between;
        overflow: hidden;

        .cover-img {
            width: 150px;
            height: 150px;
            flex: 0 0 auto;
            margin-right: 30px;

            img {
                width: 100%;
                height: 100%;
                object-fit: cover;
            }
        }

        .content {
            flex: 1 1 auto;
            justify-content: space-between;
            width: 0;

            .title {
                font-weight: 600;
                font-size: 30px;
                margin-bottom: 10px;
            }

            .desc {
                flex: 1 1 auto;
            }

            .time {
                font-size: 24px;
                color: #999;
            }
        }
    }
}
</style>